package patrol.mobile.com.mobilepatrol.activity.toll;

import android.support.annotation.NonNull;

import java.util.List;

import patrol.mobile.com.mobilepatrol.R;
import patrol.mobile.com.mobilepatrol.activity.CommonHomeActivity;
import patrol.mobile.com.mobilepatrol.activity.office.ExaminationAllActivity;
import patrol.mobile.com.mobilepatrol.activity.office.HomeDataHelper;
import patrol.mobile.com.mobilepatrol.activity.office.OtherBusinessActivity;
import patrol.mobile.com.mobilepatrol.activity.office.OtherBusinessSearchNewActivity;
import patrol.mobile.com.mobilepatrol.adapter.MyHomeAdapter;
import patrol.mobile.com.mobilepatrol.bean.HomeDataBean;
import patrol.mobile.com.mobilepatrol.bean.MenuBean;
import patrol.mobile.com.mobilepatrol.bean.MenuConstants;

/**
 * Created by K on 2018/9/12.
 * des:收费稽查以及服务区管理主页
 */
public class TollManagerHomeActivity extends CommonHomeActivity {
//    private static final String[] stringsTop = new String[]{ "综合查询", "日常管理", "其他业务"};
//    private static final String[] stringsSub1 = new String[]{"收费站信息", "服务区信息", "岗位考核汇总", "交通量汇总", "收费额汇总", "其他业务查询"};
//    private static final String[] stringsSub2 = new String[]{"岗位考核", "我的考核", "收费额上报", "申诉处理"};
//    private static final String[] stringsSub3 = new String[]{"其他业务"};
//    private static final int[] img1 = new int[]{R.mipmap.toll_station_information, R.mipmap.service_information, R.mipmap.assessment_pool, R.mipmap.affic_collection, R.mipmap.collection_charges, R.mipmap.other_queries};
//    private static final int[] img2 = new int[]{R.mipmap.post_assessment, R.mipmap.my_assessment, R.mipmap.charge_up, R.mipmap.complaint_andling};
//    private static final int[] img3 = new int[]{R.mipmap.other};

    private List<MenuBean> menuBeanList;
    @NonNull
    @Override
    protected String initTitleName() {
        return "收费及服务";
    }

    @NonNull
    @Override
    protected List<HomeDataBean> initAdapterData() {
        menuBeanList= (List<MenuBean>) getIntent().getSerializableExtra(MenuConstants.MENU_DATA);
        return HomeDataHelper.getInstance().getHomeData(
                MenuConstants.FEEGL_TOP_TITLES,
                MenuConstants.FEEGL_CHILD_TITLES_1,
                MenuConstants.FEEGL_CHILD_TITLES_2,
                MenuConstants.FEEGL_CHILD_IMGS_IMG_1,
                MenuConstants.FEEGL_CHILD_IMGS_IMG_2,
                menuBeanList);
    }

    @Override
    public void setListener() {
        super.setListener();
        mAdapter.setItemClickListener(new MyHomeAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(int parentPosition, int childPosition) {
                if (parentPosition == 0) {
                    if (childPosition == 0) {
                        TollAndServiceAreaActivity.show(TollManagerHomeActivity.this, "收费站信息");
                    } else if (childPosition == 1) {
                        TollAndServiceAreaActivity.show(TollManagerHomeActivity.this, "服务区信息");
                    } else if (childPosition == 2) {
                        startActivity(ExaminationAllActivity.class);//岗位考核汇总
                    } else if (childPosition == 3) {
                        startActivity(TrafficAllActivity.class);//交通量汇总
                    } else if (childPosition == 4) {
                        startActivity(SummaryOfChargesActivity.class);//收费额汇总
                    } else {
                        startActivity(OtherBusinessSearchNewActivity.class);//其他业务查询
                    }
                } else if (parentPosition == 1) {
                    if (childPosition == 0) {
                        startActivity(JobEvaluationActivity.class);//岗位考评
                    } else if (childPosition == 1) {
                        startActivity(MyEvaluationActivity.class);//我的考核
                    } else if (childPosition == 2) {
                        startActivity(TrafficChargeActivity.class);//交通量、收费额上报
                    } else {
                        startActivity(AppealListActivity.class);//申诉处理
                    }
                } else if (parentPosition == 2) {
                    startActivity(OtherBusinessActivity.class);//其它业务
                }
            }
        });
    }
}
